<?php

namespace api\modules\app\models;

use Yii;

/**
 * This is the model class for table "test".
 *
 * @property integer $id
 * @property string $iot_code
 * @property string $unit_code
 */
class Test extends \api\modules\app\models\BaseModel
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'test';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('test_3');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['iot_code', 'unit_code'], 'required'],
            [['iot_code', 'unit_code'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'Id',
            'iot_code' => 'Iot Code',
            'unit_code' => 'Unit Code',
        ];
    }
}